<script>
    // 对象的解构赋值
    // 注意：解构一个不存在的属性会返回undefined
    const obj = { name: "周杰伦", age: 20, hobby: "唱歌" };
    //   console.log(obj.name);
    //   console.log(obj.age);
    //   console.log(obj.hobby);
    let hobby = "睡觉";
    let { hobby: zjlHobby, name, email } = obj;
    console.log(name, zjlHobby, email);

    //   数组的解构赋值
    const user = ["猪爸爸", "猪妈妈"];
    let [father, mother] = user;
    console.log(father, mother);
</script>